<template>
	<!-- 图文信息 -->
	<imgText 
		:element="element" 
		@selectImg="emit('selectImg',$event)" 
		v-if="name == 'imgTextMultiple' || name == 'imgText'">
	</imgText>
	
	<!-- 商城轮播 -->
	<shopSwiper 
		v-if="name == 'shopSwiper'"
		:element="element"
		@selectImg="emit('selectImg',$event)">
	</shopSwiper>

	<!-- 跳转页面 -->
	<friendlyLink
		v-if="name == 'friendlyLink'"
		:element="element" 
		@selectImg="emit('selectImg',$event)">
	</friendlyLink>

	<!-- 页面标题 | 文本信息 -->
	<keyVal 
		v-if="name == 'pageTitle' || name == 'text'" 
		:element="element">
	</keyVal>

	<!-- 底部菜单 -->
	<tabbarList 
		v-if="name == 'tabbarList'" 
		:element="element"
		@selectImg="emit('selectImg',$event)">
	</tabbarList>

	<!-- 多行文本 -->
	<textMultiple
		v-if="name == 'textMultiple'" 
		:element="element"
	></textMultiple>

	<!-- 多图 -->
	<aImgs
		v-if="name == 'imgs'" 
		:element="element"
		@selectImg="emit('selectImg',$event)"
		@delImg="emit('delImg',$event)"
	></aImgs>
</template>

<script setup>
	//组件列表
	import tabbarList from "./diy-tabbar.vue"
	import shopSwiper from "./diy-shopSwiper.vue"
	import keyVal from "./diy-keyVal.vue"
	import friendlyLink from "./diy-friendly_link.vue"
	import imgText from "./diy-img-text.vue"
	import aImgs from "./diy-imgs.vue"
	import textMultiple from "./diy-textMultiple.vue"
	
	const emit = defineEmits(["selectImg"]); //自定义事件
	
	//接受父组件参数
	const props = defineProps({
		element:{
			type: Object,
			default: () => {
				return {}
			}
		},
		name: {
			type: String,
			default:''
		}
	})
</script>

<style>
</style>